home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / amac44b.zip / QLST15.QM < prev    next >
Text File  |  1992-05-27  |  15KB  |  345 lines

  1. *                               QLST15.QM
  2. *              Macros To Load a File List of Files In Ring
  3. *                        Written by Tom Hogshead
  4. *                With Macro Contribution by Kyle Watkins
  5. *                                 6/1/92
  6. *                                                                     Load
  7. * Key    Subfile      Macros To Load File List of Files In Ring  Byts Secs
  8. * === ==============  =========================================  ==== ====
  9. * @1  {e:\up\qlst@1}  Does NOT Read First File's Macros (K Watkins)19  67
  10. *
  11. * @2  {e:\up\qlst@2}  Reads First File's Macros If It Exists,      50  31 |new
  12. *                     Selects Files At ListFiles Prompt
  13. *
  14. * @3  {e:\up\qlst@3}  <BEST>
  15. *                     Reads First File's Macros If It Exists,   >> 77  26 |new
  16. *                     Selects Files At ListFiles Prompt,
  17. *                     Makes List Paragraph For Fast Loading
  18. *
  19. * @f1 {e:\up\qlst@f1} Emulates PC Mag. Filectrl.com                54  31 |new
  20. *
  21. * @f2 {e:\up\qlst@f2} <FASTEST>
  22. *                     Loads Only First File In Ring,
  23. *                     Emulates PC Mag. Filectrl.com                25   6+|new
  24. *
  25. *
  26. * @f3 {e:\up\qlst@f3} Emulates PC Mag. Filectrl.com,               81  27 |new
  27. *                     Makes List Paragraph For Fast Loading
  28. *
  29. *         Description
  30. *         Syntax
  31. *         Load QLST Files, How To
  32. *         File List qlst.ql Contents
  33. *         Fit In Qconfig.dat
  34. *         Configuration - MUST do
  35. *         Stopping @f1-@f3
  36. *         Timing Measurements
  37. *         What's Best?  See Timing Measurements
  38. *         Macros
  39. *         Version History
  40. *
  41. *--eoi
  42.  
  43.  
  44. * 
  45. * (DESCRIPTION)
  46. * --------------
  47. * QLST15.QM are macros to load a file list of files into the QEdit
  48. * ring.  The number of files in the list is practically unlimited.
  49.  
  50. * The excellent macro @1 below, written by Kyle Watkins of SemWare, is
  51. * the basis for all macros in QLST15.QM.  This macro takes advantage of
  52. * the fact that by specifying CurrentFilename plus a space plus the
  53. * desired file name in the EditFile prompt, both the current file plus
  54. * the file marked in the file list are loaded into the ring.  EditFile,
  55. * like the QEdit command line, accepts multiple file names together,
  56. * separated by spaces as if they had been load via a wildcard.
  57.  
  58. * Loading the current file returns us to the buffer we are in with no
  59. * disk access.  The end result is that the file from the list is
  60. * entered in QEdit's "ring" without actually loading it.  It only loads
  61. * when we either Nextfile into it, or it is selected from the file
  62. * selection prompt(s).
  63.  
  64. * In attempting to optimize Kyle's file loading technique for speed and
  65. * size, it was found that using a Nul file to copy the file list to
  66. * before loading significantly reduces loading time.  Macros @2, @3, f1
  67. * and f3 use this Nul file technique, which reduces the number of disk
  68. * acceses because the Nul file is always the current file for
  69. * currentfilename and Dos never acceses the disk to load Nul.  The
  70. * number of disk acceses using the Nul technique is reduced by the
  71. * number of file lines in the file list.  This is important loading
  72. * long file lists.
  73.  
  74. * Two of the macros, @3 and @f3 format the file list in the Nul file to
  75. * a single paragraph before loading, which also improves file loading
  76. * times.  Timing results below also suggest that using a cache with
  77. * these macros is a 'must'.
  78.  
  79. * For what macro is best, see discussion in Timing Measurements.
  80.  
  81. * Some of these macros require QEdit v2.15.
  82.  
  83. * RINGnn.QM in AMACnn.ZIP contains other macros to save and
  84. * subsequently load at another editing session a list of files in ring.
  85.  
  86.  
  87. * 
  88. * (SYNTAX)
  89. * ---------
  90. *            Q  d:\path\name.ql  /Ed:\path\QLSTnn.MAC, where
  91. *               name          is the file list name with extension 'ql', and
  92. *               QLSTnn.MAC    is the macro file name containing the macro
  93. *                             as the first macro in the file QLSTnn.QM.
  94.  
  95. * Because of it's speed, size and versatility, I keep macro @3 in a
  96. * separate macro file, qlst.mac, in g:\qe.  To load QLST15.QM files I
  97. * would, therefore, use:
  98.  
  99. *            Q  qlst.ql /Eg:\qe\qlst.mac , where
  100. *               qlst.ql       is the file list for QLST15.QM, and
  101. *               qlst.mac      is macro @3 duplicated in qlst.qm
  102.  
  103. * QLST15.QM files can also be loaded with any of the following
  104. * commands:
  105. *            Q  qlst.ql /EQLST15.MAC  (Uses @1)
  106. *            Q  qlst.ql /Eqlst@1.mac    "   "
  107. *            Q  qlst.ql /Eqlst@2.mac
  108. *            Q  qlst.ql /Eqlst@3.mac
  109. *            Q  qlst.ql /Eqlst@f1.mac
  110. *            Q  qlst.ql /Eqlst@f2.mac
  111. *            Q  qlst.ql /Eqlst@f3.mac
  112.  
  113. * Different file lists can be loaded by changing 'qlst.ql' to file list
  114. * d:\path\name.ext as shown in the Syntax above.
  115.  
  116.  
  117. * 
  118. * TO (LOAD) QLST FILES
  119. * ---------------------
  120. *     1)  Type any of the above commands or the following to load QLST
  121. *         files, or:   START QLST  <enter>.
  122. *     2)  All macros, except @1, enable the user to select a file to
  123. *         load at the prompt(s).  Selecting the first file in qlst.ql
  124. *         will load this file in a full window for editing.  Selecting
  125. *         another file at the prompt, will load that file in a full
  126. *         window for editing, and the macros of QLST15.QM will be read
  127. *         with macros @2 and @3.
  128. *     3)  Files from other file lists can be loaded while QLST15.MAC
  129. *         macros are loaded by loading that file's file list in another
  130. *         window and executing any of the macros.
  131. *     4)  Another option is to put any of the macros except qlst@f3 (it
  132. *         won't fit) in your QCONFIG.DAT on one line.  You will then be
  133. *         able to load other file lists at all times while editing any
  134. *         file.
  135.  
  136. * 
  137. * (FILE) LIST qlst.ql
  138. * --------------------
  139. * Contents of the QLST15.QM file list qlst.ql are:
  140. *
  141. *                ┌── qlst.ql ──┐
  142. *                │QLST15.QM    │
  143. *                │qlst@1.qm    │
  144. *                │qlst@2.qm    │
  145. *                │qlst@3.qm    │
  146. *                │qlst@f1.qm   │
  147. *                │qlst@f2.qm   │
  148. *                │qlst@f3.qm   │
  149. *                │qlst.qm      │
  150. *                │qlst.inf     │
  151. *                │read.me      │
  152. *                │allmacro.inf │
  153. *                │allmac.inf   │
  154. *                │qlst.lst     │
  155. *                │qlst.ql      │
  156. *                └─────────────┘
  157.  
  158.  
  159. * 
  160. * (FIT) IN QCONFIG.DAT
  161. * ---------------------
  162. * All macros, except @f3, will fit on one line of Qconfig.dat.
  163.  
  164. * 
  165. * (Configuration)  - MUST do
  166. * ---------------------------
  167. * In order to access files and/or invoke macros in different
  168. * directories, file names containing 'e:\up\'  MUST be configured for
  169. * the user directory containing AMAC files.  See Bookxx.QM for
  170. * instructions.
  171.  
  172. * 
  173. * Stopping @f1-@f3
  174. * ------------------
  175. * Macros @f1-@f3 may be stopped by either pressing 'Ctrl Break Esc Esc'
  176. * or 'Esc' three times.
  177.  
  178. * 
  179. * (TIMING) MEASUREMENTS, (What)'s Best ?
  180. * ---------------------------------------
  181. * File list loading times using these macros using the file Allmac.ql
  182. * were measured with a stop watch.  These times and the number of files
  183. * loaded per second (fps) were calculated and are summarized below.
  184. * File Allmac.ql consisted of:
  185.  
  186. *          95 files
  187. *         103 lines
  188. *          17 empty lines
  189. *          17 files on 8 lines with other files,
  190. *             1 line has 3 files, 7 lines have 2 files each
  191.  
  192. * I find the best and fastest file load macro is @3.  Of the macros
  193. * that load all files in the ring, it loads files the fastest.  This
  194. * macro loads a file list of files in the QEdit ring, reads the macfile
  195. * of the first file in the file if it exists.   At the ListFiles prompt
  196. * the user may select any file from the ring to load or press escape
  197. * and be positioned in the first file in the file list in a full window
  198. * for editing.  This macro is somewhat faster than @2 because it
  199. * formats the file list in the Nul file to a single paragraph before
  200. * loading, which also improves file loading times.
  201.  
  202.  
  203. * Macro @f2 loads the fastest, but only the first file is the list is
  204. * loaded in the ring.  This macro prompts the user, however, to select
  205. * other files for loading, and it may be useful with very long file
  206. * lists when only a few files need to be accessed.
  207.  
  208.  
  209. *            Cache off                     Cache on
  210. *         ==============      ==================================
  211. *                                AMAC42            These Macros
  212. *  Macro      (w/nul)           (w/o nul)            (w/nul)
  213. *  -----  --------------      -------------       --------------
  214. *         (secs)   (fps)      (secs)  (fps)       (secs)  (fps)
  215. *   @1      164     0.58        67     1.42
  216. *   @2       80     1.19        67     1.42         31     3.06
  217. *   @3       75     1.27        33     2.88      >> 26     3.65 <<
  218.  
  219. *   @f1      80     1.19        67     1.42         31     3.06
  220. *   @f2      11     8.64      >> 6    15.83 <<
  221. *   @f3      80     1.19        33     2.88         27     3.52
  222.  
  223.  
  224.  
  225. *                            M A C R O S  (Macros)
  226. * ----------------------------------------------------------------------
  227. * @(1)  Load File List In Ring, Does NOT Read First File's Macros,
  228. *      (Kyle Watkins, author)
  229. * ----------------------------------------------------------------------
  230. * This macro will load a file list of files into the QEdit ring.  The
  231. * number of files in the list is practicaly unlimited.  This excellent
  232. * macro, written by Kyle Watkins of SemWare, is the basis for all other
  233. * macros in QLSTnn.QM.  See Description above for discussion how it
  234. * works.  This macro is also included in a separate file qlst@1.qm.
  235.  
  236. @1       MacroBegin
  237.          EndFile BegLine              * start at last line
  238.        REPEAT:
  239.          UnmarkBlock MarkLine Copy    * grab this name
  240.          EditFile                     * get ready to load
  241.          CurrentFilename " "          * to force return *here*
  242.          Paste Return                 * paste file name & do it!
  243.          CursorUp                     * more lines above?
  244.          JTrue REPEAT                 * if yes, repeat.
  245. *
  246. * 19 bytes Tue  07-31-1990  18:30:10 (KW @1, size added by TH)
  247.  
  248. * 
  249. * -----------------------------------------------------------------------
  250. * @(2)  Load File List In Ring,
  251. *       Read First File In Filelist Macro If It Exists,
  252. *       User Selects File To Load From ListFiles Prompt
  253. * ----------------------------------------------------------------------
  254. * This macro loads a file list of files in the QEdit ring, reads the
  255. * macfile of the first file in the file if it exists.   At the
  256. * ListFiles prompt the user may select any file from to ring to load or
  257. * press escape and be positioned in the first file in the file list in
  258. * a full window for editing.
  259.  
  260. * If the first file in the file list does not have a 2 letter extension
  261. * (I use 'qm'), and a corresponding macro with the same name and
  262. * extension 'mac' does not exist, the macro must be modified in order
  263. * to read the macro of the first file in the list.
  264.  
  265. * If the first file in the file list does not have a corresponding
  266. * macro at all, the macro treats the first file as a normal (i.e.
  267. * non-macro) file for editing.
  268.  
  269. * (This macro is in a separate file qlst@2.qm.)
  270.  
  271. * 
  272. * ----------------------------------------------------------------------
  273. * @(3)  Load File List In Ring,
  274. *       Read First File In Filelist Macro If It Exists,
  275. *       User Selects File To Load From ListFiles Prompt,
  276. *       Makes Paragraph of File List For Faster Loading
  277. * ----------------------------------------------------------------------
  278. * This macro loads a file list of files in the QEdit ring, reads the
  279. * macfile of the first file in the file if it exists.   At the
  280. * ListFiles prompt the user may select any file from to ring to load or
  281. * press escape and be positioned in the first file in the file list in
  282. * a full window for editing.  As can be seen in Timing Measurements,
  283. * this macro is somewhat faster than @2 because it formats the file
  284. * list in the Nul file to a single paragraph before loading, which also
  285. * improves file loading times.
  286.  
  287. * If the first file in the file list does not have a 2 letter extension
  288. * (I use 'qm'), and a corresponding macro with the same name and
  289. * extension 'mac' does not exist, the macro must be modified in order
  290. * to read the macro of the first file in the list.
  291.  
  292. * If the first file in the file list does not have a corresponding
  293. * macro at all, the macro treats the first file as a normal (i.e.
  294. * non-macro) file for editing.
  295.  
  296. * ( This macro is in a separate file qlst@3.qm. )
  297.  
  298. * 
  299. * ----------------------------------------------------------------------
  300. * @(f1) Load File List In Ring,
  301. *       User Selects File To Load Emulating PC Magazine Filectrl.com,
  302. * ----------------------------------------------------------------------
  303. * ( This macro is in a separate file qlst@f1.qm. )
  304.  
  305.  
  306. * 
  307. * ----------------------------------------------------------------------
  308. * @(f2) Load File List In Ring,
  309. *       User Selects File To Load Emulating PC Magazine Filectrl.com,
  310. *       Loads Only First File In Ring
  311. * ----------------------------------------------------------------------
  312. * Macro @f2 loads the fastest, but only the first file is the list is
  313. * loaded in the ring.  This macro prompts the user, however, to select
  314. * other files for loading, and it may be useful with very long file
  315. * lists when only a few files need to be accessed.
  316.  
  317. * ( This macro is in a separate file qlst@f2.qm. )
  318.  
  319.  
  320. * 
  321. * ----------------------------------------------------------------------
  322. * @(f3) Load File List In Ring,
  323. *       User Selects File To Load Emulating PC Magazine Filectrl.com,
  324. *       Makes Paragraph of File List For Faster Loading,
  325. * ----------------------------------------------------------------------
  326. * ( This macro is in a separate file qlst@f3.qm. )
  327.  
  328.  
  329. * 
  330. * (VERSION) HISTORY
  331. * ------------------
  332. *       1.4  - Changed file name ! to NUL in @0 in QLST0.QM.
  333. *       1.4a - Minor documentation changes.
  334. *       1.4b - Shortened @0.                                           2/16/92
  335. *            - In AMAC42.ZIP.                                          3/28/92
  336. *       1.5  - Changed @0 to @2.  QEdit v2.15 required.                 5/5/92
  337. *            - Removed qlst0.qm.                                        5/5/92
  338.              - Moved file list loading macros from RINGnn.QM.           5/6/92
  339. *            - Re-wrote documentation.                                  5/6/92
  340. *
  341. *
  342. *
  343. *
  344. *--(eof)
  345.